package com.lianda.mutiple.pattern.future;

public interface FutureService<IN, OUT> {

    //不需要返回值的任务
    Future<?> submit(Runnable runnable);

    //需要返回值的任务
    Future<OUT> submit(Task<IN, OUT> task, IN input);

    Future<OUT> submit(Task<IN, OUT> task, IN input, Callback<OUT> callback);

    static <T, R> FutureService<T, R> newService() {
        return new FutureServiceImpl<>();
    }
}
